package com.java.program_questions;

import java.util.Scanner;

/**
 * 问题：判断一个素数能被几个9整除
 * 分析：
 */
public class Question44 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入一个素数：");
        int n = sc.nextInt();

        int a = 0, count = 0;
        for (int i = 2; i < n; i++) {
            if (n % i == 0) {
                a = 1;
                break;
            }
        }
        if (a == 0) {
            while (n % 9 == 0) {
                count++;
                n /= 9;
            }
        }
        System.out.print("能被9整除的次数：" + count);
    }
}
